package com.kol.collect.controller.admin;

import com.kol.collect.service.admin.AdminDriverService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.*;

import com.alibaba.fastjson.JSON;

@CrossOrigin(origins = "*", maxAge = 3600)
@Controller
@RequestMapping(value = "/admin/driver", method = RequestMethod.POST, consumes = "application/json", produces = "application/json")
public class AdminDriverController {

    @Autowired
    private AdminDriverService driverService;

    @RequestMapping(value = "/{version}/save")
    @ResponseBody
    public String save(@PathVariable("version") String version, @RequestBody(required = false) String data) {
        return JSON.toJSONString(driverService.save(data));
    }

}